import urllib.request
import urllib.error

urll = 'http://www.goudan11111.com'

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
}

try:
    request = urllib.request.Request(url=urll,headers=headers)
    response = urllib.request.urlopen(request)
    content = response.read().encode('utf-8')
    print(content)
except urllib.error.HTTPError:
    print(1111)
except urllib.error.URLError:
    print(2222)
